import java.io.*;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

public class VideoFileReader {
	
	FileInputStream fin;
	FileChannel fcin;
	
	VideoFileReader(String video_file_name)
			throws FileNotFoundException {
		fin = new FileInputStream(video_file_name);
		fcin = fin.getChannel();
	}

	int getNextFrame(ByteBuffer buffer) throws IOException {
		//System.out.println("Reading next frame...");
		return fcin.read(buffer);
	}	
	
	void close() throws IOException {
		fcin.close();
		fin.close();
	}

}
